import { SysCustomWidgetType, OnlineFormEventType } from '@/common/staticDict/index';

const customTitle = {
  span: {
    name: '组件宽度',
    widgetType: SysCustomWidgetType.Slider,
    value: 12,
    min: 1,
    max: 24,
  },
  showLine: {
    name: '显示色块',
    widgetType: SysCustomWidgetType.Switch,
    value: true,
  },
  showBorderLine: {
    name: '下边框线',
    widgetType: SysCustomWidgetType.Switch,
    value: false,
  },
  backgroundColor: {
    name: '背景颜色',
    widgetType: SysCustomWidgetType.ColorPicker,
    value: undefined,
  },
  titleAlign: {
    name: '标题位置',
    widgetType: SysCustomWidgetType.Select,
    value: 'left',
    dropdownList: [
      { name: '左对齐', id: 'left' },
      { name: '居中', id: 'center' },
      { name: '右对齐', id: 'right' },
    ],
  },
  lineWidth: {
    name: '色块宽度',
    widgetType: SysCustomWidgetType.Input,
    value: '3px',
  },
  lineColor: {
    name: '色块颜色',
    widgetType: SysCustomWidgetType.ColorPicker,
    value: '#409EFF',
  },
  fontSize: {
    name: '字体大小',
    widgetType: SysCustomWidgetType.NumberInput,
    value: 16,
  },
  fontColor: {
    name: '字体颜色',
    widgetType: SysCustomWidgetType.ColorPicker,
    value: '#333',
  },
  paddingBottom: {
    name: '底部距离',
    widgetType: SysCustomWidgetType.NumberInput,
    value: 0,
    min: 0,
  },
};

const customTitleConfig = {
  widgetType: SysCustomWidgetType.Title,
  icon: 'online-icon icon-custom-title',
  attribute: customTitle,
  allowEventList: [OnlineFormEventType.VISIBLE],
  supportBindTable: false,
  supportBindColumn: false,
};

export default customTitleConfig;
